import React, { useEffect, useState } from 'react'
import { Swiper, Image } from 'react-vant';
import axios from 'axios';
import "../../../api/Data"
import {IMGSTYPE} from "../../../types/router.d"
function Index() {
   const [arr,setArr]=useState([])
   const [dataarr,setdataarr]=useState([])
   const [listarr,setlistarr]=useState([])
  useEffect(() => {
    axios.get("/api/imgs").then(res => {
      setArr(res.data.imgs)
    })
    axios.get("/api/data").then(res => {
      setdataarr(res.data.data)
    })
    axios.get("/api/list").then(res => {
      setlistarr(res.data.list)
    })
  }, [])
  console.log(arr,dataarr);
  
  return (
    <div className="index">
      <div className="demo-swiper">
        <Swiper>
          {arr.map((item, index) => (
            <Swiper.Item key={index}>
              <Image lazyload src={item} />
            </Swiper.Item>
          ))}
        </Swiper>
      </div>
      
    </div>
  )
}

export default Index